﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Drawing;
using System.Windows.Forms;
//using DevExpress.XtraEditors;

namespace BLL2
{
    public class SuLyAnh
    {
        //public int DodaiMang(string ImgP)
        //{
        //    using (FileStream FS = new FileStream(ImgP, FileMode.Open, FileAccess.Read))
        //    {
        //        return Convert.ToInt32(FS.Length);
        //    }   
        //}

        public byte[] Hinh_Mang(PictureBox ptc)
        {
            MemoryStream ms = new MemoryStream();
            ptc.Image.Save(ms,System.Drawing.Imaging.ImageFormat.Jpeg);
            return ms.ToArray();
        }

        public MemoryStream _MemoryStream(byte[] ByteHinh)
        {
            return new MemoryStream(ByteHinh);
        }
        
        public Image Mang_Hinh(byte[] Array_Image)
        {
            return Image.FromStream(_MemoryStream(Array_Image));
        }
    }
}
